const { app, PORT } = require('./config/app');
const { initializeTables } = require('./config/database');

// 导入路由
const fileRoutes = require('./routes/fileRoutes');
const versionRoutes = require('./routes/versionRoutes');
const annotationRoutes = require('./routes/annotationRoutes');

// 初始化数据库表
initializeTables();

// 注册路由
app.use('/api', fileRoutes);
app.use('/api', versionRoutes);
app.use('/api', annotationRoutes);

// 启动服务器
app.listen(PORT, () => {
    console.log(`服务器运行在端口 ${PORT}`);
});